package com.bt.lms.ui.page.school_education.query_details;

import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;

/**
 * 学员基本信息详情界面
 */
public class PageCheckBasicMes extends VBox {
    private Integer baseWidth = 1230;

    private Integer hBoxWidth = 1230 - 300;



    public PageCheckBasicMes(PageCheckManage pageCheckManage){

        VBox totalVBox = new VBox();
        totalVBox.setPrefWidth(1280);

        Label studentBasic = new Label("招生计划A-灭霸学员基本信息");
        studentBasic.setFont(Font.font("圆体", 20));
        totalVBox.getChildren().add(studentBasic);

        Label basicMes = new Label("基本信息");
        basicMes.setFont(Font.font("圆体", 20));
        HBox hBox1 = new HBox();
        hBox1.setPrefWidth(1280);
        hBox1.setStyle("-fx-background-color: #cec9c9");
        hBox1.getChildren().add(basicMes);
        totalVBox.getChildren().add(hBox1);
        totalVBox.setSpacing(10);

        ScrollPane scrollPane = new ScrollPane();
        scrollPane.setPrefWidth(1280);
        //设置滚动盒子只有竖向
        scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
        scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS);


        //基本信息的主盒子
        HBox one = new HBox();
        one.setPadding(new Insets(10));
        one.setPrefWidth(baseWidth);
        one.setSpacing(10);

        VBox two = new VBox();
        two.setPrefWidth(hBoxWidth / 6);
        two.setSpacing(10);
        Label numberLab = new Label("学员编号");
        Label sexLab = new Label("性别");
        Label nativeLab = new Label("籍贯");
        Label birthPlaceLab = new Label("出生地");
        Label IDTypeLab = new Label("证件类型");
        Label maritalStatusLab = new Label("婚姻状况");
        two.getChildren().addAll(numberLab, sexLab, nativeLab, birthPlaceLab, IDTypeLab, maritalStatusLab);
        one.getChildren().add(two);

        VBox three = new VBox();
        three.setPrefWidth(hBoxWidth / 3);
        three.setSpacing(10);
        Label numberMes = new Label("202301");
        Label sexMes = new Label("男");
        Label nativeMes = new Label("北京");
        Label birthPlaceMes = new Label("山西省晋城市陵川县");
        Label IDTypeMes = new Label("身份证");
        Label maritalStatusMes = new Label("未婚");
        three.getChildren().addAll(numberMes, sexMes, nativeMes, birthPlaceMes, IDTypeMes, maritalStatusMes);
        one.getChildren().add(three);


        VBox four = new VBox();
        four.setPrefWidth(hBoxWidth / 6);
        four.setSpacing(10);
        Label nameLab = new Label("姓名");
        Label birthdayLab = new Label("出生日期");
        Label nationLab = new Label("民族");
        Label Lab = new Label();
        Label IDNumberLab = new Label("证件号码");
        Label politicsStatusLab = new Label("政治面貌");
        four.getChildren().addAll(nameLab, birthdayLab, nationLab, Lab, IDNumberLab, politicsStatusLab);
        one.getChildren().add(four);

        VBox five = new VBox();
        five.setPrefWidth(hBoxWidth / 3);
        five.setSpacing(10);
        Label nameMes = new Label("灭霸");
        Label birthdayMes = new Label("2001年12月29日");
        Label nationMes = new Label("汉");
        Label labMes = new Label();
        Label IDNumberMes = new Label("140524200112290010");
        Label politicsStatusMes = new Label("团员");
        five.getChildren().addAll(nameMes, birthdayMes, nationMes, labMes, IDNumberMes, politicsStatusMes);
        one.getChildren().add(five);

        VBox six = new VBox();
        six.setPrefWidth(300);
        Pane pane = new Pane();
        pane.setPrefHeight(100);
        pane.setMaxWidth(100);
        String url = "https://img2.woyaogexing.com/2023/04/30/29c6027caa2369707f1e08e8c52d73f1.jpg";
        Image image = new Image(url);
        ImageView imageView = new ImageView(image);
        imageView.setFitWidth(100);
        imageView.setFitHeight(100);
        pane.getChildren().add(imageView);
        six.getChildren().add(pane);
        one.getChildren().add(six);
        totalVBox.getChildren().add(one);

        //初始化家庭成员信息盒子
        initFamilyMemberBox(totalVBox);


        scrollPane.setContent(totalVBox);
        this.getChildren().add(scrollPane);


    }

    /**
     * 初始化家庭成员信息盒子
     *
     * @param totalVBox 主盒子
     */
    private void initFamilyMemberBox(VBox totalVBox) {
        VBox vBox = new VBox();
        Label basicMes = new Label("家庭成员");
        HBox hBox1 = new HBox();
        hBox1.setPrefWidth(1280);
        hBox1.setStyle("-fx-background-color: #cec9c9");
        hBox1.getChildren().add(basicMes);
        basicMes.setFont(Font.font("圆体", 20));
        vBox.getChildren().add(hBox1);
        vBox.setSpacing(10);


        //学习简历信息的主盒子
        HBox totalHBox = new HBox();
        totalHBox.setPrefWidth(baseWidth);
        totalHBox.setSpacing(10);
        totalHBox.setPadding(new Insets(10));

        VBox one1 = new VBox();
        one1.setPrefWidth(baseWidth / 9);
        one1.setSpacing(10);
        Label relationLab = new Label("关系");
        Label jobUnitLab = new Label("成员工作单位");
        Label nationLab = new Label("民族");
        Label professionalSkillLab = new Label("专业技术职务");
        Label isEmergencyContact = new Label("是否紧急联系人");
        one1.getChildren().addAll(relationLab, jobUnitLab, nationLab, professionalSkillLab,isEmergencyContact);
        totalHBox.getChildren().add(one1);

        VBox one2 = new VBox();
        one2.setPrefWidth(baseWidth / 6);
        one2.setSpacing(10);
        Label relationMes = new Label("父亲");
        Label jobUnitLabMes = new Label();
        Label nationMes = new Label("汉");
        Label professionalSkillLabMes = new Label("无");
        Label isLab = new Label("无");
        one2.getChildren().addAll(relationMes, jobUnitLabMes, nationMes, professionalSkillLabMes,isLab);
        totalHBox.getChildren().add(one2);


        VBox one3 = new VBox();
        one3.setPrefWidth(baseWidth / 9);
        one3.setSpacing(10);
        Label memberNameLab = new Label("成员姓名");
        Label practitionersLab = new Label("从业");
        Label nationalityLab = new Label("国籍/地区");
        Label jobRankLab = new Label("职务级别");
        one3.getChildren().addAll(memberNameLab, practitionersLab, nationalityLab, jobRankLab);
        totalHBox.getChildren().add(one3);

        VBox one4 = new VBox();
        one4.setPrefWidth(baseWidth / 6);
        one4.setSpacing(10);
        Label memberNameLabMes = new Label("王波");
        Label practitionersLabMes = new Label("干部");
        Label nationalityMes = new Label("中国大陆");
        Label jobRankLabMes = new Label("打工人");
        one4.getChildren().addAll(memberNameLabMes, practitionersLabMes, nationalityMes, jobRankLabMes);
        totalHBox.getChildren().add(one4);


        VBox one5 = new VBox();
        one5.setPrefWidth(baseWidth / 9);
        one5.setSpacing(10);
        Label birthDataLab = new Label("出生年月");
        Label phoneLab = new Label("电话");
        Label healthConditionLab = new Label("健康状况");
        Label emileLab = new Label("电子邮箱");
        one5.getChildren().addAll(birthDataLab, phoneLab, healthConditionLab, emileLab);
        totalHBox.getChildren().add(one5);

        VBox one6 = new VBox();
        one6.setPrefWidth(baseWidth / 6);
        one6.setSpacing(10);
        Label birthDataLabMes = new Label("2001年12月29日");
        Label phoneLabMes = new Label("18834364327");
        Label healthConditionLabMes = new Label("健康");
        Label emileLabMes = new Label("1747381387@qq.com");
        one6.getChildren().addAll(birthDataLabMes, phoneLabMes, healthConditionLabMes, emileLabMes);
        totalHBox.getChildren().add(one6);


        vBox.getChildren().add(totalHBox);
        totalVBox.getChildren().add(vBox);

    }





}





